package com.example.academic_affairs_system.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 教务系统用户表
 *
 * @author hjx
 * @since 2023-01-31
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("aas_user")
@ApiModel(value = "AasUser对象", description = "教务系统用户表")
public class AasUser implements Serializable {

  private static final long serialVersionUID = 1L;

  @ApiModelProperty("主键约束")
  @TableId(value = "id", type = IdType.AUTO)
  private Long id;

  @ApiModelProperty("用户账号")
  private String username;

  @ApiModelProperty("用户密码")
  private String password;

  @ApiModelProperty("用户昵称")
  private String nickname;

  @ApiModelProperty("身份证")
  private String idCard;

  @ApiModelProperty("年龄")
  private Integer age;

  @ApiModelProperty("性别")
  private Boolean sex;

  @ApiModelProperty("联系方式")
  @TableField("`concat`")
  private String concat;

  @ApiModelProperty("家庭联系方式")
  private String familyConcat;

  @ApiModelProperty("籍贯")
  private String origin;

  @ApiModelProperty("家庭住址")
  private String address;

  @ApiModelProperty("最后一次登录时间")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private LocalDateTime lastTime;

  @ApiModelProperty("创建时间")
  @TableField(fill = FieldFill.INSERT)
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private LocalDateTime createTime;

  @ApiModelProperty("更新时间")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private LocalDateTime updateTime;

  @ApiModelProperty("是否可用")
  @TableLogic
  private Boolean enabled;
}
